<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    账号: <input class="zh" type="text">
    密码  <input class="mm" type="password">
    <button>登录</button>
</body>
</html>
<script>
    var zh=document.querySelector(".zh");
    var mm=document.querySelector(".mm");
    var dl=document.querySelector("button");


    dl.onclick=function(){
        if(zh.value=='11'&&mm.value=='11'){
            alert("登录成功");
        }else{
            alert("登录失败")
        }
    }
    
    
    
    
    </script>